package com.estar.assistsurvy.thread;

import com.estar.assistsurvy.constant.Constants;
import com.estar.assistsurvy.entity.RequestDeleteMessage;
import com.estar.assistsurvy.entity.ResponseMsg;

import android.content.Context;
import android.os.Handler;
import android.util.Log;

public class DeleteMessageThread extends BaseThread {

	private RequestDeleteMessage deleteMessage;

	public DeleteMessageThread(Context context, Handler handler, RequestDeleteMessage deleteMessage) {
		super(context, handler);
		this.deleteMessage = deleteMessage;
	}
	
	@Override
	public void run() {
		// TODO Auto-generated method stub
		url_str=Constants.NAMESPACE+Constants.DELETEMESSAGE;
		json=gson.toJson(deleteMessage);
		postRequest(url_str, json);
		Log.i("wl", "删除消息返回值"+result);
		if(result!=null){
			ResponseMsg message=new ResponseMsg();
			message=gson.fromJson(result, ResponseMsg.class);
			msg.what=2;
			msg.obj=message;
			msg.sendToTarget();
		}
	}
}
